package com.idlefish.flutterboost.action;

import android.text.TextUtils;
import android.util.Log;

import androidx.annotation.NonNull;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.idlefish.flutterboost.FlutterJsonUtil;
import com.idlefish.flutterboost.Messages;
import com.idlefish.flutterboost.intef.MethodCallAction;

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

/**
 * @功能: 支付方法Action
 * @User Lmy
 * @Creat 2022/6/21 16:30
 */
public class MethodActionSwitchFunction implements MethodCallAction {
    @Override
    public void doAction(Messages.NativeRouterApi api, @NonNull MethodCall methodCall, @NonNull MethodChannel.Result result) {
        Messages.CommonParams params = new Messages.CommonParams();
        String json = FlutterJsonUtil.toJson(methodCall.arguments);
        if (TextUtils.isEmpty(json)) {
            return;
        }
        Log.e("MethodActionSwitchFunction", json);
        api.switchFunction();
    }
}
